package mianshitimu;

import java.util.Arrays;

/**
 * @ClassName chongfu_array_chongfunums
 * @Author lupeibei
 * @create 2022/6/21 10:12 PM
 */
public class chongfu_array_chongfunums {
    //nums = [1,1,1,3,3,4,3,2,4,2]，任一值在数组中出现2次则打印出来
    public void numslength(int [] nums){
    Arrays.sort(nums);
    int n=nums.length;
        for(int i=0;i<n-1;i++){
        if(nums[i]==nums[i+1]){
            System.out.println(true);
            return;
        }
    }
        System.out.println(false);
    }
        public static void main(String[] args){
            chongfu_array_chongfunums hyu = new chongfu_array_chongfunums();
            int [] nums = {1, 1, 1, 3, 3, 4, 3, 2, 4, 2};
            hyu.numslength(nums);


        }
    }
